package com.admin.model.pojo;

import com.admin.model.base.BaseEntity;
import com.admin.monmon.handlers.MyStringTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.List;

/**
 * (User)实体类
 *
 * @author makejava
 * @since 2021-01-31 19:19:28
 */
@TableName(value = "sys_user", resultMap = "BaseResultMap")
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
public class User extends BaseEntity implements Serializable {
    private static final long serialVersionUID = -91225182066461103L;
    /**
     * id
     */
    private Long id;
    /**
     * 姓名
     */
    private String name;
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码
     */
    @NotEmpty(message = "密码不能为空", groups = Create.class)
    @NotNull(message = "密码不能null", groups = Create.class)
    private String password;
    /**
     * 头像真实路径
     */
    private String avatarPath;
    /**
     * 头像地址
     */
    private String avatarName;
    /**
     * 性别：0:位置1:男，2:女
     */
    private Integer sex;
    /**
     * 手机号
     */
    private String phone;
    /**
     * 邮箱
     */
    private String email;
    /**
     * 状态：0:停用，1:启用
     */
    private Boolean enabled;
    /**
     * 修改密码的时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime pwdResetTime;
    /**
     * 账户有效期天数
     */
    private Integer expiredDays;
    /**
     * 用户锁定
     */
    private Boolean locked;
    /**
     * 用户角色
     */
    @TableField(exist = false)
    private List<Role> roles;
    /**
     * 部门
     */
    @TableField(exist = false)
    private List<Dept> depts;
    /**
     * 岗位
     */
    @TableField(exist = false)
    private List<Job> jobs;
}